package com.java2302.vo;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class ResultVo {
    public static final int SUCCESS = 200;
    public static final int ERROR = 400;
    public static final int NOAUTH = 401;

    Integer code;
    String msg;
    Object data;

    public static ResultVo success(String msg,Object data){
        ResultVo resultVo = new ResultVo();
        resultVo.setCode(200);
        resultVo.setMsg(msg);
        resultVo.setData(data);
        return resultVo;
    }

    public static ResultVo fail(String msg,Object data){
        ResultVo resultVo = new ResultVo();
        resultVo.setCode(400);
        resultVo.setMsg(msg);
        resultVo.setData(data);
        return resultVo;
    }

}
